/*
 * Created by JFormDesigner on Wed Jun 26 08:29:49 CST 2024
 */

package scct.mds.ui;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

/**
 * @author 35403
 */
public class FormLogin extends JFrame {

    public static void main(String[] args) {
        FormLogin formLogin = new FormLogin();
        formLogin.setVisible(true);
    }
    public FormLogin() {
        initComponents();
    }

    private void btnLogin(ActionEvent e) {
        System.out.println("按钮点击了");
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents  @formatter:off
        // Generated using JFormDesigner Evaluation license - yang
        labelUser = new JLabel();
        labelPass = new JLabel();
        txtUser = new JTextField();
        btnLogin = new JButton();
        btnAeg = new JButton();
        txtPass = new JTextField();
        labelTop = new JLabel();

        //======== this ========
        var contentPane = getContentPane();
        contentPane.setLayout(null);

        //---- labelUser ----
        labelUser.setText("\u7528\u6237\u540d");
        contentPane.add(labelUser);
        labelUser.setBounds(new Rectangle(new Point(120, 125), labelUser.getPreferredSize()));

        //---- labelPass ----
        labelPass.setText("\u5bc6\u7801");
        contentPane.add(labelPass);
        labelPass.setBounds(new Rectangle(new Point(130, 175), labelPass.getPreferredSize()));
        contentPane.add(txtUser);
        txtUser.setBounds(185, 115, 135, txtUser.getPreferredSize().height);

        //---- btnLogin ----
        btnLogin.setText("\u767b\u5f55");
        btnLogin.addActionListener(e -> btnLogin(e));
        contentPane.add(btnLogin);
        btnLogin.setBounds(new Rectangle(new Point(160, 230), btnLogin.getPreferredSize()));

        //---- btnAeg ----
        btnAeg.setText("\u6ce8\u518c");
        contentPane.add(btnAeg);
        btnAeg.setBounds(new Rectangle(new Point(290, 230), btnAeg.getPreferredSize()));
        contentPane.add(txtPass);
        txtPass.setBounds(185, 165, 135, txtPass.getPreferredSize().height);

        //---- labelTop ----
        labelTop.setText("\u767b\u5f55");
        labelTop.setFont(labelTop.getFont().deriveFont(labelTop.getFont().getStyle() | Font.BOLD, labelTop.getFont().getSize() + 10f));
        contentPane.add(labelTop);
        labelTop.setBounds(new Rectangle(new Point(205, 55), labelTop.getPreferredSize()));

        {
            // compute preferred size
            Dimension preferredSize = new Dimension();
            for(int i = 0; i < contentPane.getComponentCount(); i++) {
                Rectangle bounds = contentPane.getComponent(i).getBounds();
                preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
            }
            Insets insets = contentPane.getInsets();
            preferredSize.width += insets.right;
            preferredSize.height += insets.bottom;
            contentPane.setMinimumSize(preferredSize);
            contentPane.setPreferredSize(preferredSize);
        }
        setSize(500, 375);
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents  @formatter:on
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off
    // Generated using JFormDesigner Evaluation license - yang
    private JLabel labelUser;
    private JLabel labelPass;
    private JTextField txtUser;
    private JButton btnLogin;
    private JButton btnAeg;
    private JTextField txtPass;
    private JLabel labelTop;
    // JFormDesigner - End of variables declaration  //GEN-END:variables  @formatter:on
}
